"""web URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from django.contrib import admin
from .views import views, userviews, typeviews, goodsviews

urlpatterns = [
    #后台首页
    url(r'^$', views.back, name='back'),

    #会员管理
    url(r'user/list.html$', userviews.userlist, name='userlist'),
    # 会员查看
    url(r'user/detail.html$', userviews.detail, name='detail'),
    # 审核会员
    url(r'user/changestatus$', userviews.changestatus, name='changestatus'),

    #商品类别管理
    #类别列表
    url(r'type/list.html$', typeviews.typelist, name='typelist'),
    #类别添加
    url(r'type/add.html$', typeviews.typeadd, name='typeadd'),
    #类别修改
    url(r'type/edit.html$', typeviews.typeedit, name='typeedit'),
    #类别删除
    url(r'type/del.html$', typeviews.typedel, name='typedel'),
    # 类别详情
    url(r'type/detail.html$', typeviews.typedetail, name='typedetail'),
    # 审核类别状态
    url(r'type/changestatus$',
        typeviews.type_change_status,
        name='type_change_status'),

    #商品属性管理
    # 商品特征
    url(r'trait/list.html$',
        goodsviews.goods_trait_list,
        name='goods_trait_list'),
    # 商品特征添加
    url(r'trait/add.html$', goodsviews.goods_trait_add,
        name='goods_trait_add'),
    # 商品特征修改
    url(r'trait/edit.html$',
        goodsviews.goods_trait_edit,
        name='goods_trait_edit'),
    # 获取数据
    url(r'trait/gettype$', goodsviews.gettype, name='gettype'),

    #商品管理
    #所有商品列表
    url(r'goods/list.html$', goodsviews.goodslist, name='goodslist'),
    #商品添加
    url(r'goods/add.html$', goodsviews.goodsadd, name='goodsadd'),
    #商品审核
    url(r'goods/check.html$', goodsviews.goodscheck, name='goodscheck'),
    #商品编辑
    url(r'goods/edit.html$', goodsviews.goodsedit, name='goodsedit'),
    # 商品回收站
    url(r'goods/trash.html$', goodsviews.goodstrash, name='goodstrash'),
    #商品详情
    url(r'goods/detail.html$', goodsviews.goodsdetail, name='goodsdetail'),

    #商品详情图片上传
    url(r'goods/goodsupload.html$', goodsviews.goodsupload,
        name='goodsupload'),
    #商品图片上传
    url(r'goods/upgoods_load.html$',
        goodsviews.upgoods_load,
        name='upgoods_load'),
]
